<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>Hello MUI</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<!--标准mui.css-->
		<link rel="stylesheet" href="../../css/mui.min.css">
		<!--App自定义的css-->
		<link rel="stylesheet" type="text/css" href="../../css/app.css" />
		<script src="../../js/getURLParam.js"></script>
		<link rel="stylesheet" href="../../css/global.css">
		<style>
			.mui-card .mui-control-content {
				padding: 10px;
			}
			
			.mui-control-content {
				height: 250px;
			}
			{
				background-color: #E0DBDB;
			}
			.mui-bar~.mui-content .mui-fullscreen {
				top: 44px;
				height: auto;
			}
			.mui-pull-top-tips {
				position: absolute;
				top: -20px;
				left: 50%;
				margin-left: -25px;
				width: 40px;
				height: 40px;
				border-radius: 100%;
				z-index: 30;
			}
			.mui-bar~.mui-pull-top-tips {
				top: 24px;
			}
			.mui-pull-top-wrapper {
				width: 42px;
				height: 42px;
				display: block;
				text-align: center;
				background-color: #efeff4;
				border: 1px solid #ddd;
				border-radius: 25px;
				background-clip: padding-box;
				box-shadow: 0 4px 10px #bbb;
				overflow: hidden;
			}
			.mui-pull-top-tips.mui-transitioning {
				-webkit-transition-duration: 200ms;
				transition-duration: 200ms;
			}
			.mui-pull-top-tips .mui-pull-loading {
				/*-webkit-backface-visibility: hidden;
				-webkit-transition-duration: 400ms;
				transition-duration: 400ms;*/
				
				margin: 0;
			}
			.mui-pull-top-wrapper .mui-icon,
			.mui-pull-top-wrapper .mui-spinner {
				margin-top: 7px;
			}
			.mui-pull-top-wrapper .mui-icon.mui-reverse {
				/*-webkit-transform: rotate(180deg) translateZ(0);*/
			}
			.mui-pull-bottom-tips {
				text-align: center;
				background-color: #efeff4;
				font-size: 15px;
				line-height: 40px;
				color: #777;
			}
			.mui-pull-top-canvas {
				overflow: hidden;
				background-color: #fafafa;
				border-radius: 40px;
				box-shadow: 0 4px 10px #bbb;
				width: 40px;
				height: 40px;
				margin: 0 auto;
			}
			.mui-pull-top-canvas canvas {
				width: 40px;
			}
			.mui-slider-indicator.mui-segmented-control {
				background-color: #efeff4;
			}
	
}
		</style>
	</head>

	<body style="background-color: ;">
		<!--<header class="mui-bar mui-bar-nav headerstyle" >
			<a class="mui-action-back astyle"><img src="../../images/drawable-hdpi/head_back.png"/></a>
			<span id="title">车辆列表</span>
		</header>-->
		
		<div class="mui-content" style="padding-top: 0; margin:0px;">
			<div style="padding: 0px 0px;">
				<div id="segmentedControl " class="mui-segmented-control" style="border: none;border-left: none;background: white;">
					<a class="mui-control-item vcltitle" id="aitem1" href="#item1" style="color: #5b5b5b;border-left:none ;">
						<div style="float:left;height: 20px;width: 100%;"><img id="1aitem" src="../../images/drawable-xhdpi/vehiclelist_focus_1.png" width="40px" /></div>
						<div style="float: left;margin-top: 10px;width: 100%;">关注</div>
					</a>
					<a class="mui-control-item vcltitle" id="aitem2" href="#item2" style="color: #5b5b5b;border-left:none ;">
						<div style="float:left;height: 20px;width: 100%;"><img id="2aitem" src="../../images/drawable-xhdpi/vehiclelist_statusgroup_1.png" width="40px;" /></div>
						<div style="float: left;margin-top: 10px;width: 100%;">状态分组</div>
				<!--状态分组-->
				</a>
					<a class="mui-control-item vcltitle" id="aitem3" href="#item3" style="color: #5b5b5b;border-left:none ;">
						<div style="float:left;height: 20px;width: 100%;"><img id="3aitem" src="../../images/drawable-xhdpi/vehiclelist_vehiclegroup_1.png" width="40px;" /></div>
						<div style="float: left;margin-top: 10px;width: 100%;">车辆分组</div>
				
				</a>
					<a class="mui-control-item vcltitle" id="aitem4" href="#item4" style="color: #5b5b5b;border-left:none ;">
						<div style="float:left;height: 20px;width: 100%;"><img id="4aitem" src="../../images/drawable-xhdpi/vehiclelist_presentfailure_1.png" width="40px;" /></div>
						<div style="float: left;margin-top: 10px;width: 100%;">现行故障</div>
				
				</a>
				</div>
			</div>
			<div style="height: 10px;"></div>
			<div>
				<div id="item1" class="mui-control-content mui-active">
					<div id="scroll" name="item1name" class="mui-scroll-wrapper" style="height:500px">
						<div class="mui-scroll" id="attenItem1">
							<ul class="mui-table-view" id='attention'>
							</ul>
						</div>
					</div>

				</div>
				<div id="item2" class="mui-control-content mui-content">
				</div>
				<div id="item3" class="mui-control-content">
				</div>
					<div id="item4" class="mui-control-content" >
				<div style="width:100%;text-align: center;">
				<button type="button" class="mui-btn mui-btn-primary" data-option="1" id="flt1" style="height: 50px;width:23%;font-size:12px;"  onclick="checkType123(1)">红色故障</button>
		        <button type="button" class="mui-btn mui-btn-primary mui-btn-outlined" data-option="0"  id="flt2" style="height: 50px;width:23%;font-size:12px;" onclick="checkType123(2)">黄色故障<br/>(可能降扭)</button>
		        <button type="button" class="mui-btn mui-btn-primary mui-btn-outlined" data-option="0" id="flt3" style="height: 50px;width:23%;font-size:12px;" onclick="checkType123(3)">黄色故障<br/>(不会降扭)</button>
		        <button type="button" class="mui-btn mui-btn-primary mui-btn-outlined" data-option="0" id="flt4" style="height: 50px;width:23%;font-size:12px;" onclick="checkType123(4)">其他故障</button>
				</div>
				<!--<table width="100%" cellspacing="0px" cellpadding="0px" >
						<tr style="width:100%;text-align: center;" >
						<td style="width:25%">
							<button style="width:100%"  class="mui-btn" id="flt1" onclick="checkType123(1)">
							红色
						</button>
						</td>
						<td>
						<button style="width:100%" class="mui-btn" id="flt2" onclick="checkType123(2)">
							黄色
						</button>
						</td>
						<td>
						<button style="width:100%" class="mui-btn" id="flt3" onclick="checkType123(3)">
							蓝色
						</button>
						</td>
						<td>						
						<button style="width:100%" class="mui-btn" id="flt4" onclick="checkType123(4)">
							其他
						</button>
						</td>
						</tr>	
						</table>-->
					
					<div id="scroll11" class="mui-scroll-wrapper" style="margin-top:50px;height:500px;">
						<div class="mui-scroll" id="fltItem1">
							<ul class="mui-table-view" id='flt'>
							</ul>
						</div>
					</div>

				</div>
				</div>
			</div>
		<script src="../../js/mui.min.js"></script>
		<script src="../../js/mui.pullToRefresh.js"></script>
		<script src="../../js/mui.pullToRefresh.material.js"></script>
		<script>
		var sessionid=GetQueryString("sessionid");
	        var accountid=GetQueryString("accountid");
	        var proversion=GetQueryString("proversion");
			//标记是否需要执行异步获取数据
			var item1flag=false;
			var item2flag=false;
			var item3flag=false;
			var item4flag=false;
			var isRedFlt=1;
			var	isYemFlt=0;
			var	isYenFlt=0;
			var	isElsFlt=0;
	        var vclids="";
	       	var lngs ="";
	       	var lans ="";
	       	var vcltype="";
	       	var pagerCode=0;//页码
	        var pagerStart=10;//开始长度
	        var fltpagerCode=0;//故障页码
	        var flagbool=false;
	        var thisfltupself;
	        var thisattupself;
			mui.init({
				gestureConfig:{
				   tap: true, //默认为true
				   longtap: true //默认为false
				},
				swipeBack:false //启用右滑关闭功能
			});
			(function($) {
				
				//阻尼系数
				var deceleration = mui.os.ios?0.003:0.0009;
				$('#scroll').scroll({
					indicators: true //是否显示滚动条
				});
				$('#scroll11').scroll({
					indicators: true //是否显示滚动条
				});
			$.ready(function() {
				//现行故障初始化所有下拉刷新，上拉加载。
						mui('#fltItem1').pullToRefresh({
							down: {
								callback: function() {//下拉刷新
									var self = this;
									thisfltdownself=this;
									setTimeout(function() {
										 fltpagerCode=1;//页码
										 document.getElementById("flt").innerHTML="";
										 curtFlt();//是否有数据
										 self.endPullDownToRefresh();
										 self.endPullUpToRefreshready(false);
									}, 1000);
								}
							},
							up: {
								contentrefresh:'正在加载...',
								callback: function() {
									var self = this;
									thisfltupself=this;
									setTimeout(function() {
										//var ul = self.element.querySelector('.mui-table-view');
										fltpagerCode++;//页码加1
										flagbools=curtFlt(self);//是否有数据
									}, 1000);
								},
								auto:true 
							}
						});
				//关注初始化所有下拉刷新，上拉加载。
						mui('#attenItem1').pullToRefresh({ 
							down: {
								callback: function() {//下拉刷新
									var self = this;
									setTimeout(function() {
										 pagerCode=1;//页码
										 document.getElementById("attention").innerHTML="";
										 getattention();//是否有数据
										 self.endPullDownToRefresh();
										 self.endPullUpToRefreshready(false);
									}, 1000);
								}
							},
							up: {
								contentrefresh:'正在加载...',
								callback: function() {
									var self = this;
									thisattupself=this;
									setTimeout(function() {
										//var ul = self.element.querySelector('.mui-table-view');
										pagerCode++;//页码加1
										flagbool=getattention(self);//是否有数据
									}, 1000);
								},
								auto:true
							}
						});
				});
			})(mui);
			
			item1.addEventListener('longtap', function(a) {
			var btnArray = ['取消', '添加关注'];
			mui.confirm('', '添加/取消关注功能', btnArray, function(e) {
				if (e.index == 1) {
					mui.toast('你确认了解除绑定');
				} else {
					mui.toast('你取消了解除绑定');
				}
			})
		});
	         //点击上面标签事件
	  mui(".mui-segmented-control").on("tap","a",function(){
	  	id=this.getAttribute("id");
	  	changeImg(id);//改变状态
	  		if(id=="aitem1"){//关注
	  			type="1";
	        		if(item1flag==false){
	        		}
	        	}else if(id=="aitem2"){//状态分组
	        		type="2";
	        		if(item2flag==false){
	        			getCarList();
	        		}
	        	}else if(id=="aitem3"){//品牌分组
	        		type="3";
	        		if(item3flag==false){
	        			getCarOemList();
	        		}
	        	}else if(id=="aitem4"){//现行故障
	        		type="4";
	        		if(item4flag==false){
	        			curfltSearch()
	        		}
	        	}
	  });
	        //现行故障点击
	        function checkType123(aaa){
	        	var className=document.getElementById("flt"+aaa).className.trim();
	        	
	        	//thisfltupself.refresh(false);
	        	//正在加载提示置顶  
	        	document.getElementsByClassName("mui-pull-loading")[1].innerHTML="正在加载...";
	        	document.getElementById("fltItem1").style.webkitTransform= 'translate3d(0px, 0px, 0px) translateZ(0px)'; 
	        	if(className=='mui-btn mui-btn-primary'){
	        		className='mui-btn mui-btn-primary mui-btn-outlined';
	        		document.getElementById("flt"+aaa).setAttribute("data-option","0");
	        	}else {
	        		className='mui-btn mui-btn-primary';
	        		document.getElementById("flt"+aaa).setAttribute("data-option","1");
	        	}
	        	document.getElementById("flt"+aaa).className=className;
	        	curfltSearch();
	        }
	        //现行故障查询
	        function curfltSearch(){
	        	document.getElementById("flt").innerHTML="";
	        	
	        	fltpagerCode=1;
	        	var fltArray=document.getElementsByClassName("mui-btn-primary");
    			for(var i=0;i<fltArray.length;i++){
    				var fltobj=fltArray[i];
					if(fltobj.id=="flt1"){
						if(fltobj.getAttribute("data-option")=="1"){
							isRedFlt=1;
						}else{
							isRedFlt=0;
						}
    				}else if(fltobj.id=="flt2"){
    					if(fltobj.getAttribute("data-option")=="1"){
							isYemFlt=1;
						}else{
							isYemFlt=0;
						}
    				}else if(fltobj.id=="flt3"){
    					if(fltobj.getAttribute("data-option")=="1"){
							isYenFlt=1;
						}else{
							isYenFlt=0;
						}
    				}else if(fltobj.id=="flt4"){
    					if(fltobj.getAttribute("data-option")=="1"){
							isElsFlt=1;
						}else{
							isElsFlt=0;
						}
    				}
    				}
    			curtFlt(thisfltupself);
	        }
	         //关注分组
			function getattention(self){
				var ulelementHtml=document.getElementById("attention");
				var pagerCount=5;
				 var type = "1";
				vcltype="1";
				var vclides="";
	       		var lnges ="";
	       	 	var lanes ="";
				var flagbool=true;
				/*var car = document.getElementById("car");
				var customer = document.getElementById("customer");*/
				mui.ajax(getrequestURL()+'APP/vclList',{
				//mui.ajax('../../../APP/vclList',{
				data:{param:'{"proVersion":"'+proversion+'","accountId":"'+accountid+'","sessionid":"'+sessionid+'","data":{"type":"'+type+'","pagerCode":"'+pagerCode+'","pagerCount":"'+pagerCount+'","pagerStart":"'+pagerStart+'"}}'},
				dataType:'jsonp',//服务器返回json格式数据
				type:'post',//HTTP请求类型
				/*async:false,*/
				timeout:1000000,//超时时间设置为10秒；
				success:function(data){
					var jsonObj = window.JSON.parse(data);
					if(jsonObj.resultcode=="1"){
						//获取返回数据的data
						var resultdata = jsonObj.data
						if(type=="1"){//关注
								if(resultdata.length>0){
									
								//获取每台设备的数据
								for(var i=0;i<resultdata.length;i++){
										//实现左划
										/*flt+='<li class="mui-table-view-cell">';
										flt+='<div class="mui-slider-right mui-disabled">'
										flt+='	<a class="mui-btn mui-btn-grey  ">最新位置</a>'
										flt+='	<a class="mui-btn mui-btn-yellow mui-icon mui-icon-phone">工作日志</a>'
										flt+='	<a class="mui-btn mui-btn-red mui-icon mui-icon-email"></a>'
										flt+='</div>'
										flt+='<div class="mui-slider-handle">'
										flt+='	<div class="mui-table-cell">'
										flt+='<a href="../singfile/singlevclfile.html?sessionid='+sessionid+'&accountid='+accountid+'&proversion='+proversion+'&vclid='+resultdata[i].vclid+'&vclno='+resultdata[i].vclnum+'&keyontype=1&isatn='+resultdata[i].isatn+'">'
										flt+='<span >'+resultdata[i].vclnum+' &nbsp;<span style="color: green;" class="mui-icon mui-icon-eye dis"></span>&nbsp;&nbsp;&nbsp;'+resultdata[i].pstime+'</span><br/>';
										flt+='<span style="font-size: 12px;color: grey" id="a_'+resultdata[i].vclid+'">正在加载...</span><br/>'
										flt+'</a>'
										flt+='	</div>'
										flt+='</div>'*/
										var flt = "";
										var li = document.createElement('li');
										li.className="mui-table-view-cell";
										li.style.paddingBottom="5px";
										li.style.paddingTop="5px";
										flt+='<div class="mui-col-xs-10">'
										flt+='<a href="../singfile/singlevclfile.html?sessionid='+sessionid+'&accountId='+accountid+'&proVersion='+proversion+'&vclid='+resultdata[i].vclid+'&vclno='+resultdata[i].vclnum+'&keyontype=1&isatn='+resultdata[i].isatn+'">'
										flt+='<span><h5 class="mui-ellipsis">'+resultdata[i].vclnum+' <p style="display: inline;color:yellowgreen;">'
									
										if(resultdata[i].isatn=="1"){//关注
			  							flt+='<img style="vertical-align:top;width:15px;height;auto" src="../../images/drawable-hdpi/attention.png">';
			  							}
			  							if(resultdata[i].isflt=="1"){//四级故障
			  							flt+='<img style="vertical-align:top;width:15px;height;auto" src="../../images/drawable-hdpi/failure.png">';
			  							}
			  							if(resultdata[i].keysta=="1"){//开机
			  							flt+='<img style="vertical-align:top;width:15px;height;auto" src="../../images/drawable-hdpi/park.png">';
			  							}
			  							flt+='</p><span style="float:right">'+resultdata[i].vclspeed+'km/h'+'&nbsp;&nbsp;'+resultdata[i].pstime.substring(0,10)+'</span></h5></span><br/>';
			  							flt+='<span style="font-size: 12px;color: grey" id="a_'+resultdata[i].vclid+'">正在加载...</span><br/>'
			  							flt+='</a>'
										li.innerHTML=flt;
										ulelementHtml.appendChild(li);
									vclides+=resultdata[i].vclid+",";
						  			lnges+=resultdata[i].lng+",";
						  			lanes+=resultdata[i].lat+",";
								}
								
								vclids=vclides
								lngs=lnges
								lans=lanes
								getPosition();
								if(self!=null&&self!=undefined){
									self.endPullUpToRefreshready(false);
									}
								//self.endPullUpToRefreshready(false); 
							}else{
								if(self!=null&&self!=undefined){
									self.endPullUpToRefreshready(true);
									}
								//self.endPullUpToRefreshready(true); 
								if(pagerCode==1){
									//调用状态分组
								vcltype="2";
								document.getElementById("aitem1").setAttribute("class","mui-control-item");
								document.getElementById("item1").setAttribute("class","mui-control-content");
								document.getElementById("aitem2").setAttribute("class","mui-control-item mui-active");
								document.getElementById("item2").setAttribute("class","mui-control-content mui-active");
								getCarList();
								
								}else{
								}
							}
						}
					}else{
						ulelementHtml.innerHTML="请求出错!"+jsonObj.resultcode;
					}
				},
				error:function(xhr,type,errorThrown){
					//异常处理；
					ulelementHtml.innerHTML="error";
				}
				
			});
			return flagbool;
				}
	        //状态分组
			function getCarList(){
				var f = document.getElementById("item2");
				var type = "2";
				vcltype=2;
				var vclides="";
	       		var lnges ="";
	       	 	var lanes ="";
				var flt = "";
				mui.ajax(getrequestURL()+'APP/vclList',{        
					//mui.ajax('../../../APP/vclList',{    
				data:{param:'{"proVersion":"'+proversion+'","accountId":"'+accountid+'","sessionid":"'+sessionid+'","data":{"type":"'+type+'"}}'},
				dataType:'jsonp',//服务器返回json格式数据
				type:'post',//HTTP请求类型
				timeout:10000,//超时时间设置为10秒；
				success:function(data){
					var jsonObj = window.JSON.parse(data);
					if(jsonObj.resultcode=="1"){
						//获取返回数据的data
						var resultdata = jsonObj.data;
						if(type=="2"){//设备分组
							if(null !=resultdata){
								
		            			
								flt+='<div><ul class="mui-table-view">';
								//flt+='<div ><ul class="mui-table-view">';
						  				if(null!= resultdata[0]&&resultdata[0].vcllist.length>0){
						  					flt+='<li class="mui-table-view-cell mui-collapse "><a class="mui-navigate-right" href="#">开机<span style="padding-left: 180px;">'+resultdata[0].vcllist.length+'<span></a>';
						  					flt+='<div class="mui-collapse-content" >';
						  					for(var j=0;j<resultdata[0].vcllist.length;j++){
						  						flt+='<span style="font-size:15px">'
						  						flt+='<a href="../singfile/singlevclfile.html?sessionid='+sessionid+'&accountid='+accountid+'&proversion='+proversion+'&vclid='+resultdata[0].vcllist[j].vclid+'&vclno='+resultdata[0].vcllist[j].vclno+'&keyontype=1&isatn='+resultdata[0].vcllist[j].isatn+'">'+resultdata[0].vcllist[j].vclnum+'&nbsp;&nbsp;&nbsp;&nbsp';
						  						if(resultdata[0].vcllist[j].isatn=="1"){//关注
						  							flt+='<img style="vertical-align:top;width:15px;height;auto" src="../../images/drawable-hdpi/attention.png">';
						  						}
						  						if(resultdata[0].vcllist[j].isflt=="1"){//四级故障
						  							flt+='<img style="vertical-align:top;width:15px;height;auto" src="../../images/drawable-hdpi/failure.png">';
						  						}
						  						if(resultdata[0].vcllist[j].keysta=="1"){//开机
						  							flt+='<img style="vertical-align:top;width:15px;height;auto" src="../../images/drawable-hdpi/park.png">';
						  						}
						  						flt+='<span style="font-size:10px">'+resultdata[0].vcllist[j].vclspeed+'km/h&nbsp;&nbsp;'+resultdata[0].vcllist[j].pstime.substring(0,10)+'<span>'
						  						flt+='</a>'
						  						flt+='</span><br/>'
						  						flt+='<p style="font-size:10px" id="b_'+resultdata[0].vcllist[j].vclid+'">正在加载...</p>';
						  						flt+='<hr/>';
						  						vclides+=resultdata[0].vcllist[j].vclid+",";
						  						lnges+=resultdata[0].vcllist[j].lng+",";
						  						lanes+=resultdata[0].vcllist[j].lat+",";
						  					}
						  					
											flt+='</div>'
						  				}else{
						  						flt+='<li class="mui-table-view-cell mui-collapse"><a class="mui-navigate-right" href="#">开机<span style="padding-left: 180px;">0<span></a>';
						  					}
						  				flt+='</li>';
						  				
						  				if(null!= resultdata[1]&&resultdata[1].vcllist.length>0){
						  					flt+='<li class="mui-table-view-cell mui-collapse "><a class="mui-navigate-right" href="#">关机<span style="padding-left: 180px;">'+resultdata[1].vcllist.length+'<span></a>';
						  					flt+='<div class="mui-collapse-content" >';
						  					for(var j=0;j<resultdata[1].vcllist.length;j++){
						  						flt+='<span style="font-size:15px">'
						  						flt+='<a href="../singfile/singlevclfile.html?sessionid='+sessionid+'&accountid='+accountid+'&proversion='+proversion+'&vclid='+resultdata[1].vcllist[j].vclid+'&vclno='+resultdata[1].vcllist[j].vclno+'&keyontype=2&isatn='+resultdata[1].vcllist[j].isatn+'">'+resultdata[1].vcllist[j].vclnum+'&nbsp;&nbsp;&nbsp;&nbsp';
						  						if(resultdata[1].vcllist[j].isatn=="1"){//关注
						  							flt+='<img style="vertical-align:top;width:15px;height;auto" src="../../images/drawable-hdpi/attention.png">';
						  						}
						  						if(resultdata[1].vcllist[j].isflt=="1"){//四级故障
						  							flt+='<img style="vertical-align:top;width:15px;height;auto" src="../../images/drawable-hdpi/failure.png">';
						  						}
						  						if(resultdata[1].vcllist[j].keysta=="1"){//开机
						  							flt+='<img style="vertical-align:top;width:15px;height;auto" src="../../images/drawable-hdpi/park.png">';
						  						}
						  						flt+='<span style="font-size:10px">'+resultdata[1].vcllist[j].vclspeed+'km/h&nbsp;&nbsp;'+resultdata[1].vcllist[j].pstime.substring(0,10)+'<span>'
						  						flt+='</a>'
						  						flt+='</span><br/>'
						  						flt+='<p style="font-size:10px" id="b_'+resultdata[1].vcllist[j].vclid+'">正在加载...</p>';
						  						flt+='<hr/>';
						  						vclides+=resultdata[1].vcllist[j].vclid+",";
						  						lnges+=resultdata[1].vcllist[j].lng+",";
						  						lanes+=resultdata[1].vcllist[j].lat+",";
						  					}
						  					
											flt+='</div>'
						  				}else{
						  						flt+='<li class="mui-table-view-cell mui-collapse"><a class="mui-navigate-right" href="#">关机<span style="padding-left: 180px;">0<span></a>';
						  					}
						  				flt+='</li>';
						  				
						  				
						  				if(null!= resultdata[2]&&resultdata[2].vcllist.length>0){
						  					flt+='<li class="mui-table-view-cell mui-collapse "><a class="mui-navigate-right" href="#">离线<span style="padding-left: 180px;">'+resultdata[2].vcllist.length+'<span></a>';
						  					flt+='<div class="mui-collapse-content" >';
						  					for(var j=0;j<resultdata[2].vcllist.length;j++){
						  						flt+='<span style="font-size:15px">'
						  						flt+='<a href="../singfile/singlevclfile.html?sessionid='+sessionid+'&accountid='+accountid+'&proversion='+proversion+'&vclid='+resultdata[2].vcllist[j].vclid+'&vclno='+resultdata[2].vcllist[j].vclno+'&keyontype=3&isatn='+resultdata[2].vcllist[j].isatn+'">'+resultdata[2].vcllist[j].vclnum+'&nbsp;&nbsp;&nbsp;&nbsp';
						  						if(resultdata[2].vcllist[j].isatn=="1"){//关注
						  							flt+='<img style="vertical-align:top;width:15px;height;auto" src="../../images/drawable-hdpi/attention.png">';
						  						}
						  						if(resultdata[2].vcllist[j].isflt=="1"){//四级故障
						  							flt+='<img style="vertical-align:top;width:15px;height;auto" src="../../images/drawable-hdpi/failure.png">';
						  						}
						  						if(resultdata[2].vcllist[j].keysta=="1"){//开机
						  							flt+='<img style="vertical-align:top;width:15px;height;auto" src="../../images/drawable-hdpi/park.png">';
						  						}
						  						flt+='<span style="font-size:10px">'+resultdata[2].vcllist[j].vclspeed+'km/h&nbsp;&nbsp;'+resultdata[2].vcllist[j].pstime.substring(0,10)+'<span>'
						  						flt+='</a>'
						  						flt+='</span><br/>'
						  						flt+='<p style="font-size:10px" id="b_'+resultdata[2].vcllist[j].vclid+'">正在加载...</p>';
						  						flt+='<hr/>';
						  						vclides+=resultdata[2].vcllist[j].vclid+",";
						  						lnges+=resultdata[2].vcllist[j].lng+",";
						  						lanes+=resultdata[2].vcllist[j].lat+",";
						  					}
						  					
											flt+='</div>'
						  				}else{
						  						flt+='<li class="mui-table-view-cell mui-collapse"><a class="mui-navigate-right" href="#">离线<span style="padding-left: 180px;">0<span></a>';
						  					}
						  				flt+='</li>';
						  			flt+='</ul>';
						  			flt+='</div>';
								f.innerHTML=flt;
								vclids=vclides
								lngs=lnges
								lans=lanes
								getPosition( )
							}else{
								f.innerHTML="暂无数据";
							}
						}
						
					}else{
						f.innerHTML="请求出错!"+jsonObj;
					}
				},
				error:function(xhr,type,errorThrown){
					//异常处理；
					f.innerHTML="error";
				}
			});
			}
			//品牌列表
			function getCarOemList(){
				var f = document.getElementById("item3");
				var type = "3";
				vcltype="3";
				var vclides="";
	       		var lnges ="";
	       	 	var lanes ="";
				var flt = "";
				mui.ajax(getrequestURL()+'APP/vclList',{  
					//mui.ajax('../../../APP/vclList',{
				data:{param:'{"proVersion":"'+proversion+'","accountId":"'+accountid+'","sessionid":"'+sessionid+'","data":{"type":"'+type+'"}}'},
				dataType:'jsonp',//服务器返回json格式数据
				type:'post',//HTTP请求类型
				timeout:10000,//超时时间设置为10秒；
				success:function(data){
					var jsonObj = window.JSON.parse(data);
					if(jsonObj.resultcode=="1"){
						//获取返回数据的data
						var resultdata = jsonObj.data;
						if(type=="3"){//设备分组
							flt+='<div ><ul class="mui-table-view">';
							if(null !=resultdata){
								for(var m=0;m<resultdata.length;m++){
									var keyon=0;
									if(null!=resultdata[m].vcllist&&resultdata[m].vcllist.length>0){
										for(var j=0;j<resultdata[m].vcllist.length;j++){
						  							var keysta=resultdata[m].vcllist[j].keysta;
						  							if(keysta==1){
						  							keyon++;	
						  							}
										}
									}
						  					flt+='<li class="mui-table-view-cell mui-collapse "><a class="mui-navigate-right" href="#"><span style="padding-left: 10px;">'+resultdata[m].gpname+':'+keyon+'/'+resultdata[m].vcllist.length+'<span></a>';
						  					flt+='<div class="mui-collapse-content" >';
						  					if(null!=resultdata[m].vcllist&&resultdata[m].vcllist.length>0){
						  						for(var j=0;j<resultdata[m].vcllist.length;j++){
						  							var keysta=resultdata[m].vcllist[j].keysta;
						  							
						  						flt+='<span style="font-size:10px">'
						  						flt+='<a href="../singfile/singlevclfile.html?sessionid='+sessionid+'&accountid='+accountid+'&proversion='+proversion+'&vclid='+resultdata[m].vcllist[j].vclid+'&vclno='+resultdata[m].vcllist[j].vclno+'&keyontype=1&isatn='+resultdata[m].vcllist[j].isatn+'">'+resultdata[m].vcllist[j].vclnum+'&nbsp;&nbsp;&nbsp;&nbsp';
						  						if(resultdata[m].vcllist[j].isatn=="1"){//关注
						  							flt+='<img style="vertical-align:top;width:15px;height;auto" src="../../images/drawable-hdpi/attention.png">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
						  						}
						  						if(resultdata[m].vcllist[j].isflt=="1"){//四级故障
						  							flt+='<img style="vertical-align:top;width:15px;height;auto" src="../../images/drawable-hdpi/failure.png">';
						  						}
						  						if(resultdata[m].vcllist[j].keysta=="1"){//开机
						  							flt+='<img style="vertical-align:top;width:15px;height;auto" src="../../images/drawable-hdpi/park.png">';
						  						}
						  						flt+='<span style="font-size:10px">'+resultdata[2].vcllist[j].vclspeed+'km/h&nbsp;&nbsp;'+resultdata[2].vcllist[j].pstime.substring(0,10)+'<span>'
						  						flt+='<span id="'+resultdata[m].vcllist[j].vclid+'"></span>'
						  						flt+='</a>'
						  						flt+='</span>'
						  						flt+='<P style="font-size:10px" id="c_'+resultdata[m].vcllist[j].vclid+'">正在加载...</P>';
						  						flt+='<hr/>';
						  						vclides+=resultdata[m].vcllist[j].vclid+",";
						  						lnges+=resultdata[m].vcllist[j].lng+",";
						  						lanes+=resultdata[m].vcllist[j].lat+",";
						  						}
						  					}else{
						  						flt+='<span style="padding-left: 180px;">0<span>';
						  					}
											flt+='</div>'
						  				}
						  				flt+='</li>';
								}
						  			flt+='</ul>';
						  			flt+='</div>';
								f.innerHTML=flt;
								vclids=vclides
								lngs=lnges
								lans=lanes
								getPosition();
							}else{
								f.innerHTML="暂无数据";
							}
						}
						
					else{
						f.innerHTML="请求出错!"+jsonObj;
					}
				},
				error:function(xhr,type,errorThrown){
					//异常处理；
					f.innerHTML="error";
				}
			});
			}
			
			
			  //现行故障
			function curtFlt(self){
				var f = document.getElementById("flt");
				if(self==undefined){
					f.innerHTML="";
				}
				var type = "4";
				var pagerCount=5;
				vcltype="4";
				var vclides="";
	       		var lnges ="";
	       	 	var lanes ="";
				var booleanretrue=false;
				mui.ajax(getrequestURL()+'APP/curtFlt',{
				//	mui.ajax('../../../APP/curtFlt',{
				data:{param:'{"proVersion":"'+proversion+'","accountId":"'+accountid+'","sessionid":"'+sessionid+'","data":{"type":"'+type+'","isRedFlt":"'+isRedFlt+'","isYemFlt":"'+isYemFlt+'","isYenFlt":"'+isYenFlt+'","isElsFlt":"'+isElsFlt+'","fltpagerCode":"'+fltpagerCode+'","pagerCount":"'+pagerCount+'","pagerStart":"'+pagerStart+'"}}'},
				dataType:'jsonp',//服务器返回json格式数据
				type:'post',//HTTP请求类型
				timeout:10000,//超时时间设置为10秒；
				success:function(data){
					var jsonObj = window.JSON.parse(data);
					if(jsonObj.resultcode=="1"){
						//获取返回数据的data
						var resultdata = jsonObj.data
						if(type=="4"){//故障
								if(resultdata.length>0){
								//获取每台设备的数据
								for(var i=0;i<resultdata.length;i++){
									var flt = "";
									var li = document.createElement('li');
									li.className="mui-table-view-cell";
									flt+='<div class=" mui-col-xs-10">'
									flt+='<a href="../singfile/vclCurFlt.html?accountid='+accountid+'&proversion='+proversion+'&sessionid='+sessionid+'&vclid='+resultdata[i].vclid+'&vclnum='+resultdata[i].vclnum+'">'
									flt+='<span><h5 class="mui-ellipsis">'+resultdata[i].vclnum+' <p style="display: inline;color:yellowgreen;">'
									
									if(resultdata[i].isatn=="1"){//关注
			  							flt+='<img style="vertical-align:top;width:15px;height;auto" src="../../images/drawable-hdpi/attention.png">';
			  						}
			  						if(resultdata[i].isflt=="1"){//四级故障
			  							flt+='<img style="vertical-align:top;width:15px;height;auto" src="../../images/drawable-hdpi/failure.png">';
			  						}
			  						if(resultdata[i].keysta=="1"){//开机
			  							flt+='<img style="vertical-align:top;width:15px;height;auto" src="../../images/drawable-hdpi/park.png">';
			  						}
			  						flt+='</p></h5></span>';
			  						flt+='</a>'
									flt+='<p class="mui-h6" style="height:auto;width:auto" id="d_'+resultdata[i].vclid+'">正在加载...</p>'
									var fltList=resultdata[i].fltlist;
									if(null!=fltList&&fltList.length>0){
										for(var m=0;m<fltList.length;m++){
											flt+='<p class="mui-h6" style="height:auto;width:auto;color:'+fltList[m].fltcolor+' ">'+fltList[m].fltcode+'&nbsp;&nbsp;'+fltList[m].fltrisk+'</p>'
										}
									}
									flt+='</div>'
									
									vclides+=resultdata[i].vclid+",";
						  			lnges+=resultdata[i].lng+",";
						  			lanes+=resultdata[i].lat+",";
						  			li.innerHTML=flt;
						  			f.appendChild(li);
								}
								vclids=vclides
								lngs=lnges
								lans=lanes
								getPosition();
								if(self!=null&&self!=undefined){
											self.endPullUpToRefreshready(false);
									}
							}else{
								if(self!=null&&self!=undefined){
											self.endPullUpToRefreshready(true);
										}
								
							}
						}
					}else{
						f.innerHTML="请求出错!"+jsonObj.resultcode;
					}
				},
				error:function(xhr,type,errorThrown){
					//异常处理；
					f.innerHTML="error";
				}
			});
			return booleanretrue;	
			}
			
				function getPosition(){
							mui.ajax(getrequestURL()+'APP/position',{
				data:{param:'{"proVersion":"'+proversion+'","accountId":"'+accountid+'","sessionid":"'+sessionid+'","data":{"vclids":"'+vclids+'","lngs":"'+lngs+'","lans":"'+lans+'"}}'},
				dataType:'jsonp',//服务器返回json格式数据
				type:'post',//HTTP请求类型
				timeout:10000,//超时时间设置为10秒；
				success:function(data){
					var jsonObj = window.JSON.parse(data);
					//document.getElementById("test").innerHTML="bb";
					if(jsonObj.resultcode=="1"){
						//document.getElementById("test").innerHTML=jsonObj.resultcode;
						//获取返回数据的data
						var resultdata = jsonObj.data;
							if(null !=resultdata){
								//document.getElementById("test").innerHTML="chang";
								for(var i=0;i<resultdata.length;i++){
									var arr = resultdata[i];
									//document.getElementById("test").innerHTML=resultdata[i][1];
									if(vcltype=="1"){
										document.getElementById("a_"+resultdata[i][0]).innerHTML=resultdata[i][1];
									}else if(vcltype=="2"){
										document.getElementById("b_"+resultdata[i][0]).innerHTML=resultdata[i][1];
									}else if(vcltype=="3"){
										document.getElementById("c_"+resultdata[i][0]).innerHTML=resultdata[i][1];
									}else if(vcltype=="4"){
										document.getElementById("d_"+resultdata[i][0]).innerHTML=resultdata[i][1];
									}
									
								}
							}else{
								//document.getElementById("test").innerHTML="null";
							}
						
					}else{
						//document.getElementById("test").innerHTML="null2";
					}
				},
				error:function(xhr,type,errorThrown){
					//异常处理；
					//document.getElementById("test").innerHTML=="error";
				}
			});
			}
		</script>

	</body>

</html>